package Test;

class Animals{
    public String name;
    public int age;
    public String color;

    public Animals(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }

    public void eat() {
        System.out.println(this.name + "在吃东西");
    }
}

class Dog extends Animals {

    public Dog() {
        super("小罗",10,"白色");
    }

    public void run() {
        System.out.println(this.name + "在跑");
    }
}

class Bird extends Animals {

    public Bird(String name, int age, String color) {
        super(name, age, color);
    }

    public void fly() {
        System.out.println( this.name + "在飞");
    }
}


public class Blog {
    public static void main(String[] args) {
        Dog dog = new Dog();
        dog.name = "小灰";
        dog.age = 10;
        dog.color = "灰色";
        dog.eat();
        dog.run();

        System.out.println("======================");

        Bird bird = new Bird("小辣椒",10,"红色");
        bird.eat();
        bird.fly();
    }
}

